package cn.tedu.medicalmanagementsystem.base.interceptors;

import cn.tedu.medicalmanagementsystem.manager.pojo.entity.Manager;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

@Slf4j
public class ManagerLoginInterceptor implements HandlerInterceptor {

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
//        log.debug("进入管理员登录状态校验的拦截器...");
//
//        HttpSession session = request.getSession();
//        Manager manager = (Manager) session.getAttribute("manager");
//
//        if (manager == null) {
//            // 拦截，重定向到管理员登录页面（可自定义路径）
//            response.sendRedirect("http://localhost:9091");
//            return false;
//        }
//
//        // 放行
          return true;
    }
}
